/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eleric.rememome.memo.impl;

import com.eleric.rememome.memo.Memo;
import com.eleric.rememome.memo.MemoCategory;
import com.eleric.rememome.type.FormatType;
import com.eleric.rememome.type.MemoStatusType;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 *
 * @author MWaldman
 */
public class MemoVer2 implements Memo
{
    private int id;
    private String memo;
    private MemoCategory category;
    private MemoStatusType status;
    private Calendar creationTimestamp;
    private Calendar statusTimestamp;
    private int priority;
    private final SimpleDateFormat dFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");

    public MemoCategory getCategory()
    {
        return category;
    }

    public void setCategory(MemoCategory category)
    {
        this.category = category;
    }

    public Calendar getCreationTimestamp()
    {
        return creationTimestamp;
    }

    public void setCreationTimestamp(Calendar creationTimestamp)
    {
        this.creationTimestamp = creationTimestamp;
    }

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public String getMemo()
    {
        return memo;
    }

    public void setMemo(String memo)
    {
        this.memo = memo;
    }

    public int getPriority()
    {
        return priority;
    }

    public void setPriority(int priority)
    {
        this.priority = priority;
    }

    public MemoStatusType getStatus()
    {
        return status;
    }

    public void setStatus(MemoStatusType status)
    {
        this.status = status;
    }

    public Calendar getStatusTimestamp()
    {
        return statusTimestamp;
    }

    public void setStatusTimestamp(Calendar statusTimestamp)
    {
        this.statusTimestamp = statusTimestamp;
    }

    public String getFormatedMemo(FormatType type)
    {
        switch (type)
        {
            case SIMPLE:
                return memo + " " + category.getShortName() + " " + status.name() + " " +
                        dFormat.format(creationTimestamp.getTime()) + " " +
                        dFormat.format(statusTimestamp.getTime()) + " " + priority;
//                return memo + " " + category.getShortName() + " " + status.name() + " " +
//                        creationTimestamp.getTimeInMillis() + " " +
//                        statusTimestamp.getTime() + " " + priority;
            default:
                return null;
        }
    }

    @Override
    public String toString()
    {
        return memo;
    }
}
